package me.jiatao.wan.data.mapper

import me.jiatao.wan.data.database.entity.BannerEntity
import me.jiatao.wan.data.network.pojo.BannerPojo

/**
 * @Author: JiaTao
 * @CreateDate: 2021/8/29 14:06
 * @Version: 1.0
 * @Description:
 */

object BannerMapper {
    fun bannerPojo2Entity(pojo: BannerPojo): BannerEntity {
        return BannerEntity(
            bannerId = pojo.id,
            imagePath = pojo.imagePath,
            title = pojo.title,
            url = pojo.url,
        )
    }

    fun bannerEntity2Pojo(entity: BannerEntity): BannerPojo {
        return BannerPojo(
            id = entity.bannerId,
            imagePath = entity.imagePath,
            title = entity.title,
            url = entity.url,
        )
    }
}